<html>
<head><meta charset="utf-8"><title>do I care about shims when doing codegen? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/do.20I.20care.20about.20shims.20when.20doing.20codegen.3F.html">do I care about shims when doing codegen?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="205303345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/do%20I%20care%20about%20shims%20when%20doing%20codegen%3F/near/205303345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jason Hu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/do.20I.20care.20about.20shims.20when.20doing.20codegen.3F.html#205303345">(Jul 28 2020 at 23:35)</a>:</h4>
<p>It seems there are many generated shims during the codegen process, and these shims do have MIR bodies and we are also able to fetch the bodies. my question is, when doing codegen, do we distinguish shims, or we just do codegen for all instances? I am asking because I am looking into codegening <code>call_once</code> of Fn traits but it seems the parameters etc does not look quite the same.</p>



<a name="205361967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/do%20I%20care%20about%20shims%20when%20doing%20codegen%3F/near/205361967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/do.20I.20care.20about.20shims.20when.20doing.20codegen.3F.html#205361967">(Jul 29 2020 at 14:14)</a>:</h4>
<p>Shims are compiled like normal functions. They just have special <code>InstanceDef</code> variants.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>